package day6.collect;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @author joker
 * @date 2022/4/16 0016 - 22:10
 */
public class ListTest {
    public static void main(String[] args) {
        int[] ints={1,2,3,4,5};
        Integer[] integers = {1, 2, 3, 4, 5};
        List<Integer> integers1 = Arrays.asList(integers);
        System.out.println(integers1);
        ArrayList list = new ArrayList<>();
        list.add(1);
        list.add("a");
        list.add(true);
//        list.add(null);
        System.out.println(list);
        Iterator iterator = list.iterator();
        while (iterator.hasNext()){
            iterator.remove();
            System.out.println(iterator.next());
        }
        System.out.println(list);
    }
    @Test
    public void test1(){
        StringBuffer sb = new StringBuffer();
        String str=null;
        sb.append(str);
        System.out.println(sb.length());
        System.out.println(sb);

    }
}
